<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('notice')) { return; }

        Schema::create('notice', function (Blueprint $table) {
            $table->id()->unique();
$table->string('title', 255)->comment('公告标题');
$table->text('content')->comment('内容');
$table->string('image', 255)->nullable()->comment('图片');
$table->createdAt();
$table->updatedAt();

$table->engine='InnoDB';
$table->comment('公告管理');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('notice');
    }
};
